/**
 * 
 */
package com.security.frame.core.social;

import lombok.Getter;
import lombok.Setter;
import org.springframework.social.security.SocialAuthenticationFilter;
import org.springframework.social.security.SpringSocialConfigurer;

/**
 * todo
 *
 * @author wangjie
 * @version V1.0
 * @date 2019/11/12
 */
@Getter
@Setter
public class MySpringSocialConfigurer extends SpringSocialConfigurer {
	
	private String filterProcessesUrl;

	private SocialAuthenticationFilterPostProcessor socialAuthenticationFilterPostProcessor;
	
	public MySpringSocialConfigurer(String filterProcessesUrl) {
		this.filterProcessesUrl = filterProcessesUrl;
	}
	

	@Override
	protected <T> T postProcess(T object) {
		SocialAuthenticationFilter filter = (SocialAuthenticationFilter) super.postProcess(object);
		filter.setFilterProcessesUrl(filterProcessesUrl);
		if(null != socialAuthenticationFilterPostProcessor ){
			socialAuthenticationFilterPostProcessor.process(filter);
		}
		return (T) filter;
	}


}
